

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="utf-8"%>
<%@page import="java.util.List"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="favicon.ico">
<link rel="Shortcut Icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/static/h-ui.admin/skin/default/skin.css"
	id="skin" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script><![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>商家列表 - 商家管理 - H-ui.admin v3.0</title>
<meta name="keywords"
	content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description"
	content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
	<!--_header 作为公共模版分离出去-->
	<header class="navbar-wrapper">
		<div class="navbar navbar-fixed-top">
			<div class="container-fluid cl">
				<a class="logo navbar-logo f-l mr-10 hidden-xs"
					href="index_admin.jsp">即刻平台</a> <a
					class="logo navbar-logo-m f-l mr-10 visible-xs"
					href="index_admin.jsp">即刻平台</a> <span
					class="logo navbar-slogan f-l mr-10 hidden-xs">v1.0</span> <a
					aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs"
					href="javascript:;">&#xe667;</a>
				<nav id="Hui-userbar"
					class="nav navbar-nav navbar-userbar hidden-xs">
					<ul class="cl">
						<li>超级管理员</li>
						<li class="dropDown dropDown_hover"><a href="#"
							class="dropDown_A"> ${sessionScope.Admin.adminName}<i class="Hui-iconfont">&#xe6d5;</i></a>
							<ul class="dropDown-menu menu radius box-shadow">

								<li><a href="login_admin.jsp">切换账户</a></li>

							</ul></li>
						<li id="Hui-msg"><a href="#" title="消息"><span
								class="badge badge-danger"></span><i class="Hui-iconfont"
								style="font-size: 18px">&#xe68a;</i></a></li>
						<li id="Hui-skin" class="dropDown right dropDown_hover"><a
							href="javascript:;" class="dropDown_A" title="换肤"><i
								class="Hui-iconfont" style="font-size: 18px">&#xe62a;</i></a>
							<ul class="dropDown-menu menu radius box-shadow">
								<li><a href="javascript:;" data-val="default"
									title="默认（黑色）">默认（黑色）</a></li>
								<li><a href="javascript:;" data-val="blue" title="蓝色">蓝色</a></li>
								<li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
								<li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
								<li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
								<li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
							</ul></li>
					</ul>
				</nav>
			</div>
		</div>
	</header>
	<!--/_header 作为公共模版分离出去-->

	<!--_menu 作为公共模版分离出去-->
	<aside class="Hui-aside">

		<div class="menu_dropdown bk_2">
			<dl id="menu-article">
				<dt>
					<i class="Hui-iconfont">&#xe616;</i> 首页<i
						class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
				</dt>
				<dd>
					<ul>
						<li><a
							href="${pageContext.request.contextPath}/index_admin.jsp"
							title="我的桌面">我的桌面</a></li>
					</ul>
				</dd>
			</dl>

			<dl id="menu-product">
				<dt class="selected">
					<i class="Hui-iconfont">&#xe620;</i> 商家管理<i
						class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
				</dt>
				<dd style="display: block;">
					<ul>

						<li class="current"><a href="seller" title="商家列表">商家列表</a></li>
					</ul>
				</dd>
			</dl>


			<dl id="menu-member">
				<dt>
					<i class="Hui-iconfont">&#xe60d;</i> 用户管理<i
						class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
				</dt>
				<dd>
					<ul>
						<li><a href="user" title="用户列表">用户列表</a></li>
					</ul>
				</dd>
			</dl>


		</div>
	</aside>
	<div class="dislpayArrow hidden-xs">
		<a class="pngfix" href="javascript:void(0);"
			onClick="displaynavbar(this)"></a>
	</div>
	<!--/_menu 作为公共模版分离出去-->

	<section class="Hui-article-box">
		<nav class="breadcrumb">
			<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
			商家管理 <span class="c-gray en">&gt;</span> 商家列表<a
				class="btn btn-success radius r"
				style="line-height: 1.6em; margin-top: 3px"
				href="javascript:location.replace(location.href);" title="刷新"><i
				class="Hui-iconfont">&#xe68f;</i></a>
		</nav>
		<div class="Hui-article">
			<article class="cl pd-20">

				<div class="mt-20">
					<table
						class="table table-border table-bordered table-hover table-bg table-sort"
						id="tab">
						<thead>
							<tr class="text-c">
								<th width="80">商家ID</th>
								<th width="100">店铺名称</th>
								<th width="40">店铺类型</th>
								<th width="90">店铺logo</th>
								<th width="70">店铺地址</th>
								<th width="60">联系方式</th>
								<th width="60">营业时间</th>
								<th width="60">桌子数量</th>
								<th width="60">状态</th>
								<th width="60">审核状态</th>
								<th width="60">操作</th>

							</tr>
						</thead>
						<tbody>
							<c:forEach var="l" items="${requestScope.list}">
								<tr>

									<td>${l.sellerId}</td>
									<td>${l.storeName}</td>
									<td>${l.storeType}</td>
									<td>${l.storeLogo}</td>
									<td>${l.storeAddress}</td>
									<td>${l.storeTel}</td>
									<td>${l.businessHours}</td>
									<td>${l.deskNum}</td>
									<td class="td-status"><c:if test="${l.storeState== 1}">
											<span class="label label-success radius">${l.storeState== 1 ? "营业中" : "休息中"}
											</span>
										</c:if> <c:if test="${l.storeState== 0}">
											<span class="label label-defaunt radius">${l.storeState== 0? "休息中" : "营业中"}
											</span>
										</c:if></td>

									<td class="td-status"><c:if test="${l.sState== 1}">
											<span class="label label-success radius">${l.sState== 1 ? "审核已通过" : "审核未通过"}
											</span>
										</c:if> <c:if test="${l.sState== 0}">
											<span class="label label-defaunt radius">${l.sState== 0? "审核未通过" : "审核已通过"}
											</span>
										</c:if></td>

									<td class="td-manage"><c:if test="${l.sState== 0}">
											<a style="text-decoration: none"
												href="upState?sellerId=${l.sellerId}&sState=${l.sState}"
												title="审核已通过"><i class="Hui-iconfont">&#xe631;</i></a>
										</c:if> <c:if test="${l.sState== 1}">
											<a style="text-decoration: none"
												href="upState?sellerId=${l.sellerId}&sState=${l.sState}"
												title="审核已通过" title="审核未通过"><i class="Hui-iconfont">&#xe6e1;</i></a>
										</c:if>
										    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<a style="text-decoration: none"  class="delseller ml-5" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<a title="编辑" href="javascript:;" onclick="updateSeller('编辑商家信息','album-class-add_admin.jsp')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
										</td>
										
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
				<div id="demo7" style="margin-right: 2%; margin-top: 100px;"></div>
			</article>
		</div>
	</section>

	<!--_footer 作为公共模版分离出去-->
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/lib/layer/2.4/layer.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/static/h-ui/js/H-ui.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/static/h-ui.admin/js/H-ui.admin.page.js"></script>
	<!--/_footer /作为公共模版分离出去-->

	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.table-sort').dataTable({
				"aaSorting" : [ [ 1, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 0, 9 ]
				} // 制定列不参与排序
				]
			});
			
			/*删除单个*/
			$('.delseller').click(
					function() {
						
						// 获取商家Id，根据Id删除商家
						var sellerId =  $(this).parents("tr").find("td").eq(0).text();
					
						console.log("sellerId:"+sellerId);
						layer.confirm('确定要删除'+sellerId+'号商家吗？', {
							btn : [ '确定', '取消' ],
							
							yes : function(index) {
								layer.close(index);
								$.ajax({
									//请求类型
									type : 'delete',
									//请求的地址,@RequestMapping的值
									url : 'delseller/'+sellerId,
									//从服务器[控制器]一侧返回的数据类型
									dataType : 'json',
									//完整的代码，是三个参数，第一个参数result是返回的结果
									// 第二个参数是状态
									//第三个对象 xmlHttpRequest对象
									success : function(result, status, xhr) {

										console.log("result:" + result);
										
										 layer.msg(result, {
											icon : 1,
											time : 2000
										//2秒关闭（如果不配置，默认是3秒）
										}, function() {
											window.location.reload();
										}); 

									}
								});
								
								
							}
						});

					});

			$("#plDel").click(function() {

				batchIds();

			});

			//获取所有选中行的UUID
			function batchIds() {

				/* var uuid = '';
				var uuids = eloancn.table.grid.rows(".selected").data();
				if (uuids.length == 0) {
					alert(eloancn.table.statusTitle);
				} else {
					// 上面是自带的语句,大概意思就是判断有没有选数据,没有的话进行提示
					// 下面是选中数据后
					// 创建一个数组empId的数组进行存放选中行所对应要操作的empId
					var uId = new Array();
					// 循环往数组里添加数据
					for (var i = 0; i < uuids.length; i++) {
						userId.push(uuids[i]['uId']);
					}
					layer.confirm('确认要删除吗？', function() {
						//这里进行ajax
						$.ajax({
							type : 'POST',
							url : '../us.do?op=batchDel',
							// 传递数组
							data : {
								'uId' : uId
							},
							// 设置traditional: true后才能传到servlet里面去
							traditional : true,
							dataType : 'text',
							success : function(data) {
								layer.msg('删除成功!', {
									icon : 1,
									time : 1000
								});
								// 不管是否操作成功都进行页面刷新,重新加载数据
								reload();
							},
							error : function(data) {
								layer.msg('删除失败!', {
									icon : 1,
									time : 1000
								});
							},
						});

					});
				} */

				$("#Tab input[type=checkbox]:checked").each(function() {
					n = $(this).parents("tr").index();
				});

			}

		});
	</script>

	<script type="text/javascript">
		/*删除多用户（被选中）*/
		$(function() {

			var strSel = '';
			$('.delUserBySelected').click(function() {

				$("[name='selected']:checked").each(function(index, element) {
					strSel += $(this).val() + ",";
				});
				if (strSel.length > 0) { //如果获取到
					strSel = strSel.substring(0, strSel.length - 1);//把最后一个逗号去掉
				}
				/*
				alert("选中项："+strSel);
				 */
				/*
						layer.confirm('确定要删除所选的用户吗？', {
							btn : [ '确定', '取消' ],
							yes : function(index) {
								layer.close(index);
								$.get('Picture.do?op=delBySelected&strSel=' + strSel, function(
										data) {
									layer.msg(data, {
										  icon: 1,
										  time: 1000 //2秒关闭（如果不配置，默认是3秒）
										}, function(){
											window.location.reload();
										});  
									
								});
							}
						});
				 */

			});
		});
	</script>

	<script type="text/javascript">

	
	/*编辑商家信息*/
	function updateSeller(title,url){
		/*layer_show(title,url,w,h);	*/
		
		layer.open({
			type: 2,
			title: title,
			content: url,
			area: ['600px', '320px'],
			offset: 'auto',	
			end: function(index, layero){
				window.location.reload();
			}
		}
		);
	}
	</script>
	<!--/请在上方写此页面业务相关的脚本-->


</body>
</html>